package com.yufubao.api.controller.management.check;

import com.yufubao.framework.annotation.SystemLog;
import com.yufubao.framework.constant.NotesConstant;
import com.yufubao.framework.result.ResponseResult;
import com.yufubao.model.dto.management.check.MerchantApplicationDto;
import com.yufubao.service.service.management.check.CheckService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author 张一恒
 * @version 1.0
 * @description:
 * @date 2024/9/5 23:05
 */
@RestController
@RequestMapping("/applet/management/check/supplier")
public class CheckController {

    @Autowired
    private CheckService checkService;

    /**
     * 分页查询/根据id查询,审核成功/待审核/审核失败的基本信息
     */
    @ApiOperation(value = "分页查询审核成功/待审核/审核失败的基本信息", notes = NotesConstant.DEV)
    @RequestMapping(value = "/searchAllStatusInfo", method = RequestMethod.POST)
    @SystemLog(info = "分页查询审核成功/待审核/审核失败的基本信息")
    public ResponseResult searchAllStatusInfo(@RequestBody Map<String,Object> params) {
        return checkService.searchAllStatusInfo(params);
    }


    /**
     * 根据id查询,待审核
     */
    @ApiOperation(value = "根据id查询,待审核", notes = NotesConstant.DEV)
    @RequestMapping(value = "/searchWaitPass/{supplierInfoId}", method = RequestMethod.GET)
    @SystemLog(info = "根据id查询,待审核")
    public ResponseResult searchWaitPass(@PathVariable("supplierInfoId") Long supplierInfoId) {
        return checkService.searchWaitPass(supplierInfoId);
    }

    /**
     * 用户申请商户成功
     */
    @ApiOperation(value = "用户申请商户成功", notes = NotesConstant.DEV)
    @RequestMapping(value = "/merchantApplicationSuccess", method = RequestMethod.POST)
    @SystemLog(info = "用户申请商户成功")
    public ResponseResult merchantApplicationSuccess(@RequestBody @Validated(MerchantApplicationDto.success.class) MerchantApplicationDto dto) {
        return checkService.merchantApplicationSuccess(dto);
    }


    /**
     * 用户申请商户失败
     */
    @ApiOperation(value = "用户申请商户失败", notes = NotesConstant.DEV)
    @RequestMapping(value = "/merchantApplicationFila", method = RequestMethod.POST)
    @SystemLog(info = "用户申请商户失败")
    public ResponseResult merchantApplicationFila(@RequestBody @Validated(MerchantApplicationDto.fila.class) MerchantApplicationDto dto) {
        return checkService.merchantApplicationFila(dto);
    }


}
